<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>登录博客</title>
    <style>
        body {
            font-family: Arial;
            background: url('./image/bg1.png') no-repeat center center fixed;
            background-size: cover;
        }
        .login-box {
            width: 300px;
            padding: 20px;
            margin: 100px auto;
            background: white;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .input-field {
            width: 100%;
            padding: 10px;
            margin: 8px 0;
            border: 1px solid #ccc;
            border-radius: 3px;
            box-sizing: border-box;
        }
        .submit-btn {
            width: 100%;
            padding: 10px;
            background: #4c74af;
            color: white;
            border: none;
            border-radius: 3px;
            cursor: pointer;
        }
        .error { color: red; text-align: center; }
    </style>
</head>
<body>
<div class="login-box">
    <h2 style="text-align: center">用户登录</h2>

    <%-- 显示错误信息 --%>
    <% if (request.getParameter("error") != null) { %>
    <p class="error">用户名或密码错误！</p>
    <% } %>

    <form action="login" method="post">
        <input type="text" name="account" placeholder="用户名" class="input-field" required>
        <input type="password" name="pwd" placeholder="密码" class="input-field" required>
        <p class="text-red-500 text-sm">${msg}</p>
        <button type="submit" class="submit-btn">登录</button>
        <button type="submit" class="submit-btn" onclick="window.location.href='registerPage'">注册</button>
    </form>
</div>
</body>
</html>